package com.liuceng.rabbitmq.service;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.remoting.support.RemoteInvocation;
import org.springframework.remoting.support.RemoteInvocationResult;
import org.springframework.stereotype.Service;


@Service
public class RabbitmqService {
    @Autowired
    private AmqpTemplate amqpTemplate;

    public void getRabbitmq(String input){
        System.out.println(input);
    }

    public void send(){
        for(int i=0;i<10;i++){
            amqpTemplate.convertAndSend("exchangeTest", "queueTest",
                    "消息"+i);
        }
    }


}
